Skip to content

✅ remove unit test noise - #4673

Merged
BenoitZugmeyer merged 5 commits into
mainfrom
benoit.zugmeyer/reduce-unit-test-noise
May 26, 2026
Merged

✅ remove unit test noise#4673
BenoitZugmeyer merged 5 commits into
mainfrom
benoit.zugmeyer/reduce-unit-test-noise

Conversation

@BenoitZugmeyer

Copy link
Copy Markdown
Member

Motivation

Running the unit test suite produced noisy, non-actionable console output, which made it harder to spot real failures quickly.

Changes

  • centralize delivery API warning/error spies in debugger delivery API unit tests.
  • mute debugger API warning output in unit tests by reusing a shared warning spy.
  • reset lifecycle tracker when stopping the session manager to prevent leaked listener logs between tests.
  • mute console.error output in the buffered data console test while preserving assertions.
  • replace placeholder image/source src/srcset values with data URLs in serialization tests to avoid noisy 404 requests.

Test instructions

  1. Run:
    yarn test:unit
  2. Verify the suite passes.
  3. Verify there is no unexpected output in the console logs.

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

avoid noisy console output during yarn test:unit by stubbing display.error and display.warn in deliveryApi.spec.ts setup and reusing those spies in assertions.
stub display.warn in api.spec.ts setup and reuse the shared spy in assertions to avoid noisy console output during unit runs.
ensure stopSessionManager() tears down lifecycleTracker listeners to prevent leaked listeners across tests and repeated session manager lifecycles.
stub console.error in bufferedData.spec.ts so the test still validates console log buffering without printing noisy test output.
replace placeholder image/source src and srcset values with data URLs in serializeAttributes.spec.ts to avoid noisy 404 requests during unit test runs.
@cit-pr-commenter-54b7da

Copy link
Copy Markdown

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum 173.45 KiB 173.45 KiB 0 B 0.00%
Rum Profiler 8.07 KiB 8.07 KiB 0 B 0.00%
Rum Recorder 21.23 KiB 21.23 KiB 0 B 0.00%
Logs 56.79 KiB 56.79 KiB 0 B 0.00%
Rum Slim 131.17 KiB 131.17 KiB 0 B 0.00%
Worker 22.99 KiB 22.99 KiB 0 B 0.00%

🔗 RealWorld

@BenoitZugmeyer
BenoitZugmeyer marked this pull request as ready for review May 26, 2026 13:17
@BenoitZugmeyer
BenoitZugmeyer requested review from a team as code owners May 26, 2026 13:17
@datadog-datadog-prod-us1-2

Copy link
Copy Markdown

Tests

🎉 All green!

🧪 All tests passed
❄️ No new flaky tests detected

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 76.77% (-0.05%)

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 11dd139 | Docs | Datadog PR Page | Give us feedback!

@BenoitZugmeyer BenoitZugmeyer changed the title ✅ use data urls in serializeAttributes image test cases ✅ remove unit test noise May 26, 2026
@BenoitZugmeyer
BenoitZugmeyer merged commit e0107f4 into main May 26, 2026
26 checks passed
@BenoitZugmeyer
BenoitZugmeyer deleted the benoit.zugmeyer/reduce-unit-test-noise branch May 26, 2026 13:32
@github-actions github-actions Bot locked and limited conversation to collaborators May 26, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants